import { Routes, RouterModule }  from '@angular/router';
import { ModuleWithProviders } from '@angular/core';
import {PagesComponent} from "./pages.component";

export const routes: Routes = [
  {
    path: 'login',
    loadChildren: 'app/pages/login/login.module#LoginModule'
  },
  {
    path: 'pages',
    component: PagesComponent,
    children: [
      { path: '', redirectTo: 'region', pathMatch: 'full' },
      { path: 'account', loadChildren: 'app/pages/account/account.module#AccountModule' },
      { path: 'region', loadChildren: 'app/pages/region/region.module#RegionModule' },
      { path: 'department', loadChildren: 'app/pages/department/department.module#DepartmentModule' },
      { path: 'role', loadChildren: 'app/pages/role/role.module#RoleModule' },
      { path: 'authority', loadChildren: 'app/pages/authority/authority.module#AuthorityModule' },
    ]
  }
];

export const PagesRouting: ModuleWithProviders = RouterModule.forChild(routes);
